
// 大驼峰命名转下划线命名
const sourceName = 'ThisIsAFieldName';
function Trans(str: string): string {
  const s = str.replace(/([A-Z])/g, '_$1').slice(1).toLowerCase();
  return s;
}
const res = Trans(sourceName);
console.log(res);
